package com.job.Gai_Yian.Homework0716;


import java.util.Scanner;
import java.util.concurrent.CountDownLatch;

/**
 * @author Gai_Yian
 * @version 1.0
 * @since 2022-07-17 23:11:38
 */
public class CharCount {
    private static Integer count=1;
    private static Character code;

    public static void Count(String string){
        char[] ch=new char[string.length()];
        ch=string.toCharArray();
        char[] ch01=new char[string.length()];
        int[] num=new int[string.length()];
        int j=0;
        for (int i=0;i<string.length();i++){
            if (Character.isUpperCase(ch[i])){
                ch01[j]=ch[i];
                for (int k=i+1;k<string.length();k++){
                    if (ch[i]==ch[k]){
                        count++;
                        ch[k]='0';
                    }
                }
                num[i]=count;
                count=1;
                j++;
            }
        }
        for (int i = 0; i <j-1 ; i++) {
            for (int k = i+1; k <j ; k++) {
                if (num[i]==num[k]){
                    int temp;
                    temp=num[i];
                    num[i]=num[k];
                    num[k]=temp;
                    code=ch[i];
                    ch[i]=ch[k];
                    ch[k]=code;
                }
            }
        }
        for (int i = 0; i <j ; i++) {
            System.out.print(ch[i]+",");
            System.out.println(num[i]);
        }
    }
    public static void main(String[] args) {
        Character code=null;
        Integer count=null;
        Scanner sc=new Scanner(System.in);
        String str=sc.next();
        Count(str);
    }
}
